<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns the documentation for the given option name</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="tidy.getopt.html">tidy::getOpt</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="tidy.getrelease.html">tidy::getRelease</a></div>
 <div class="up"><a href="class.tidy.html">tidy</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="tidy.getoptdoc" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">tidy::getOptDoc</h1>
  <h1 class="refname">tidy_get_opt_doc</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0)</p><p class="refpurpose"><span class="refname">tidy::getOptDoc</span> -- <span class="refname">tidy_get_opt_doc</span> &mdash; <span class="dc-title">
   Returns the documentation for the given option name
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-tidy.getoptdoc-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>tidy::getOptDoc</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$optname</code></span>
   )</div>

  <p class="para rdfs-comment">过程化风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>tidy_get_opt_doc</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.tidy.html" class="type tidy">tidy</a></span> <code class="parameter">$object</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$optname</code></span>
   )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>tidy_get_opt_doc()</strong></span> returns the documentation for the
   given option name.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    You need at least libtidy from 25 April, 2005 for this function be
    available.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-tidy.getoptdoc-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">object</code></em></dt>

     <dd>

      <p class="para">
       The <a href="class.tidy.html" class="classname">Tidy</a> 对象。
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">optname</code></em></dt>

     <dd>

      <p class="para">
       The option name
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-tidy.getoptdoc-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a string if the option exists and has documentation available, or
   <strong><code>FALSE</code></strong> otherwise.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-tidy.getoptdoc-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3956">
    <p><strong>Example #1 Print all options along with their documentation and default value</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$tidy&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">tidy</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$config&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getConfig</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">ksort</span><span style="color: #007700">(</span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br /><br />foreach&nbsp;(</span><span style="color: #0000BB">$config&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$opt&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$val</span><span style="color: #007700">)&nbsp;{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">$doc&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOptDoc</span><span style="color: #007700">(</span><span style="color: #0000BB">$opt</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$doc&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'no&nbsp;documentation&nbsp;available!'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$val&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOpt</span><span style="color: #007700">(</span><span style="color: #0000BB">$opt</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">)&nbsp;&nbsp;?&nbsp;</span><span style="color: #DD0000">'true'&nbsp;&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">$val</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$val&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOpt</span><span style="color: #007700">(</span><span style="color: #0000BB">$opt</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">)&nbsp;?&nbsp;</span><span style="color: #DD0000">'false'&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">$val</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;p&gt;&lt;b&gt;</span><span style="color: #0000BB">$opt</span><span style="color: #DD0000">&lt;/b&gt;&nbsp;(default:&nbsp;'</span><span style="color: #0000BB">$val</span><span style="color: #DD0000">')&lt;br&nbsp;/&gt;"</span><span style="color: #007700">.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$doc</span><span style="color: #DD0000">&lt;/p&gt;&lt;hr&nbsp;/&gt;\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-tidy.getoptdoc-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="tidy.getconfig.html" class="function" rel="rdfs-seeAlso">tidy::getconfig()</a> - Get current Tidy configuration</span></li>
    <li class="member"><span class="function"><a href="tidy.getopt.html" class="function" rel="rdfs-seeAlso">tidy::getopt()</a> - Returns the value of the specified configuration option for the tidy document</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="tidy.getopt.html">tidy::getOpt</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="tidy.getrelease.html">tidy::getRelease</a></div>
 <div class="up"><a href="class.tidy.html">tidy</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
